home *** CD-ROM | disk | FTP | other *** search
/ SIGGRAPH 2002 Course Notes / SIGGRAPH 2002 - Course Notes - Disc 1.iso / pc / notes / 05 / supplemental_material / RNL_Source / angmap.cal next >
Encoding:
Text File  |  1999-01-02  |  383 b   |  22 lines

  1.  
  2. {
  3. angmap.cal
  4.  
  5. Convert from directions in the world to coordinates on the angular sphere image
  6.  
  7. -z is forward (outer edge of sphere)
  8. +z is backward (center of sphere)
  9. +y is up (toward top of sphere)
  10. }
  11.  
  12. sb_u = 0.5 + DDx * r;
  13. sb_v = 0.5 + DDy * r;
  14.  
  15. r = 0.159154943*acos(DDz)/sqrt(DDx*DDx + DDy*DDy);
  16.  
  17. DDy = Py*norm;
  18. DDx = Px*norm;
  19. DDz = Pz*norm;
  20.  
  21. norm = 1/sqrt(Py*Py + Px*Px + Pz*Pz);
  22.